from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from almodel import Account, Message, Transaction#, Base

if __name__ == '__main__':
    engine = create_engine('sqlite:///../../out/db/db.sqlite', echo=False)
    Session = sessionmaker(bind=engine) 
    session = Session()
    
    a = Account()
    a.id = 1
    
    a=session.merge(a)
    
    print a, len(a.transactions)
#    Base.metadata.create_all(engine)
#    ed_user = User('ed', 'Ed Jones', 'edspassword')
#    session.add(ed_user)

#    a = session.query(Account).filter(Account.nr_rachunku == '79114020040000370236901698').first()
#
#    print a
#    
#    t = a.transactions[0]
#    t.accountId = 13
#    session.commit()
    
